/*
 * Copyright (c) 2018-2025, duneng All rights reserved.
 *
 * Author: wq (meteor85@163.com)
 */
import request from '@/router/axios'

export function getLatestSensorData(sId,sType){
    return request({
        url:'admin/sensorData/getLatestSensorData',
        params:{
            searchId:sId,
            searchType:sType
        }

    })
}
//获取对象的实时汇总数据组,对象为企业、园区、市、省、全国,返回值为所有下属机构的实时汇总值
export function getLatestSensorList(sId,sType){
    return request({
        url:'admin/sensorData/getLatestSensorList',
        params:{
            searchId:sId,
            searchType:sType
        }

    })
}

// 获取一段时间的传感器实时数据，类型为传感器以外的类型，按分钟汇总值
export function getSensorDataForPeriodOfTime(sId,sType,startTime,endTime){
    return request({
        url:'admin/sensorData/getSensorDataForPeriodOfTime',
        params:{
            searchId:sId,
            searchType:sType,
            startTime:startTime,
            endTime:endTime
        }

    })
}

// 获取一段时间的传感器实时数据，类型为传感器以外的类型，按分钟汇总值
export function getStatisticsData(sId,sType,dataType,startTime,endTime){
    return request({
        url:'admin/sensorData/getStatisticsData',
        params:{
            searchId:sId,
            searchType:sType,
            dataType:dataType,
            startTime:startTime,
            endTime:endTime
        }

    })
}



//获取一段时间内的TOP5数据，
export function getTop5StaticData(sId,sType,dataType,startTime,endTime){
    return request({
        url:'admin/sensorData/getTop5StaticData',
        params:{
            searchId:sId,
            searchType:sType,
            dataType:dataType,
            startTime:startTime,
            endTime:endTime
        }

    })
}

//获取指定时点的TOP5数据，
export function getTop5PointData(sId,sType){
    return request({
        url:'admin/sensorData/getTop5PointData',
        params:{
            searchId:sId,
            searchType:sType,
        }

    })
}

export function getCompanyDataByIndustryId(industryId,companyType,dataType,startTime,endTime){

    return request({
        url:'admin/sensorData/getCompanyDataByIndustryId',
        method:'get',
        params:{
            industryId:industryId,
            companyType:companyType,
            dataType:dataType,
            startTime:startTime,
            endTime:endTime,
        }
    })
}

export function getCompanySumDataByIndustryId(industryId,companyType,dataType,startTime,endTime){

        return request({
            url:'admin/sensorData/getCompanySumDataByIndustryId',
            method:'get',
            params:{
                industryId:industryId,
                companyType:companyType,
                dataType:dataType,
                startTime:startTime,
                endTime:endTime,
            }
        })
    }

/*
*发点小时估算
*/
export function getIndustryCalculateById(industryId,dataType,startTime,endTime,ratio,designCapacity){
    return  request({
        url:'admin/sensorData/getIndustryCalculateById',
        method:'get',
        params:{
            industryId:industryId,
            dataType:dataType,
            startTime:startTime,
            endTime:endTime,
            ratio:ratio,
            designCapacity:designCapacity
        }
    })
}

/**
 * 获取园区指定时间的数据倒序
 * @param {园区id} industryId 
 * @param {数据类型} dataType 
 * @param {开始时间} startTime 
 * @param {结束时间} endTime 
 */
export function getIndustryDayDateOrderByDesc(industryId,dataType,startTime,endTime){
    return  request({
        url:'admin/sensorData/getIndustryDayDateOrderByDesc',
        method:'get',
        params:{
            industryId:industryId,
            dataType:dataType,
            startTime:startTime,
            endTime:endTime,
        }
    })
}

/**
 * 获取某个月按照小时汇总的典型日的数据
 * @param {园区id} industryId 
 * @param {开始时间} startTime 
 * @param {结束时间} endTime 
 */
export function getIndustryTypicalDateInfoById(industryId,startTime,endTime){
    return  request({
        url:'admin/sensorData/getIndustryTypicalDateInfoById',
        method:'get',
        params:{
            industryId:industryId,
            startTime:startTime,
            endTime:endTime,
        }
    })
}

